package com.fastjrun.eladmin.itrms.domain;

import com.fastjrun.eladmin.itrms.common.exception.DomainException;

public enum SERVER_STATUS {
    NOT_ALLOCATE(1,"未分配"),
    ALLOCATED(2,"已分配");

    SERVER_STATUS(int key, String value){
        this.key =key;
        this.value =value;
    }
    private int key;
    private String value;

    public static String getValue(int key){
        for(SERVER_STATUS server_status: SERVER_STATUS.values()){
            if(server_status.key==key){
                return server_status.value;
            }
        }
        throw new DomainException(String.format("the enum SERVER_STATUS for key:%d not provided.",key));
    }


}
